/*
 * @Author: adolphus adolphus520@163.com
 * @Date: 2022-12-11 22:29:08
 * @LastEditors: 姚杰鸿
 * @LastEditTime: 2025-01-23 15:51:55
 * @Description: file content
 */
import req from "@/lib/axios";

export const UserApi = (info: string, attr: boolean) =>
  req({
    url: `/user${info}`,
    method: "get",
    headers: {
      "q-attr-info": attr ? "1" : "",
    },
  });

export const GetUserApi = (account: string) =>
  req({
    url: `/user/${account}`,
    method: "get",
  });

export const IsValidUserAccountApi = (id: number, account: string) =>
  req({
    url: `/user/valid/${id}/${account}`,
    method: "get",
  });

export const UserPostApi = (user: any) =>
  req({ url: "/user", method: "post", data: user });

export const UserDeleteApi = (user: any) =>
  req({ url: `/user/${user.account}`, method: "delete" });

export const UserVfCodeApi = (mobile: string) =>
  req({ url: `/user/verification/code/${mobile}`, method: "get" });

export const UserCheckVfCodeApi = (mobile: string, code: string) =>
  req({
    url: `/user/check/verification/code/${mobile}/${code}`,
    method: "get",
  });

export const UserResetAutkeyApi = (user: any) =>
  req({ url: `/user/reset/authkey`, method: "post", data: user });

export const SendVfCodeApi = (mobile: string) =>
  req({ url: `/send/verification/code/${mobile}`, method: "get" });
